"use strict";
function paramsSplit(path) {
    let temp = { id: "", name: "" };
    //字符串处理
    const index = path.indexOf("?");
    //id=1&name=xiaowang
    const res = path.substring(index + 1);
    console.log(res);
    //["id=1","name=xiaowang"]
    const array = res.split("&");
    for (const key of array) {
        // ["id","1"]
        const values = key.split("=");
        // key as keyof user
        let mykey = values[0];
        temp[mykey] = values[1];
    }
    return;
}
paramsSplit("http://127.0.0.1:3000?id=1&name=xiaowang");
